package nuc.soft.xsf.controller;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

import net.sf.json.JSONObject;
import nuc.soft.xsf.model.Report;
import nuc.soft.xsf.service.IReportService;
import nuc.soft.xsf.tools.Tools;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/ReportController", produces = "text/html;charset=UTF-8")
public class ReportController {
	@Resource
    private IReportService reportService;
	
	@RequestMapping(value = "/findByCondition.action", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String findByCondition(Report report){
		Map map=Tools.transBean2Map(report);
		List<Report> reportList=reportService.findByCondition(map);
		JSONObject json=new JSONObject();
		json.put("list", reportList);
		return json.getString("list"); 
	}
	
	
	
	
}
